#include "data.h"
#include <QTextStream>
#include <QStringList>

DataHRM::DataHRM(QFile& file) 
{
  const char* BEGINDATA = "[HRData]";
  QTextStream in(&file);
  QString line;
	
  /* vai avanti fino a HRData */
  do {
    line = in.readLine();
  }
  while(!line.isNull() && line != BEGINDATA);
	
  int n1, n2, n3;
  hrVector = new QVector<int>(0);
  speedVector = new QVector<int>(0);
  altVector = new QVector<int>(0);
  
  while(!in.atEnd())
    {
      in >> n1 >> n2 >> n3;
      hrVector->append(n1);
      speedVector->append(n2);
      altVector->append(n3);
    }
  hrVector->pop_back();
  speedVector->pop_back();
  altVector->pop_back();
  
}

QVector<int>* DataHRM::getHRData()
{
  return hrVector;
}

QVector<int>* DataHRM::getSpeedData()
{
  return speedVector;
}

QVector<int>* DataHRM::getAltData()
{
  return altVector;
}
